package com.biz.user.job;

import com.xxl.job.core.biz.model.*;
import com.xxl.job.core.context.*;
import com.xxl.job.core.handler.annotation.*;
import lombok.extern.slf4j.*;
import org.apache.commons.lang.*;
import org.springframework.stereotype.*;

/**
 * @Description
 *      使用xxl-job
 * @Author liuxi
 * @Date 2024/5/5
 **/
@Component
@Slf4j
public class TestXxlJob {

    @XxlJob("demoJobHandler")
    public ReturnT<String> demoJobHandler() {
        // 获取参数
        String jobParam = XxlJobHelper.getJobParam();
        System.out.println(jobParam);
        if (StringUtils.isBlank(jobParam)) {
            jobParam = "123";
        }
        System.out.println(jobParam);
        return ReturnT.SUCCESS;
    }
}
